package loengud.w11.simpsons;

public class Homer implements Runnable {

	CookieJar jar;

	public Homer(CookieJar jar) {
		this.jar = jar;
	}

	public void eat() {
		jar.getCookie("Homer");

		try {
			Thread.sleep((int) Math.random() * 1000);
		} catch (InterruptedException ie) {
		}
	}

	public void run() {
		for (int i = 1; i <= 10; i++)
			eat();
	}
}
